#ifndef GRAPHICS_H
#define GRAPHICS_H

#include <Windows.h>
#include <d3d11.h>
#include <D3DX11.h>
#include <d3dx10.h>
#include "Logger.h"
#include "Constants.h"

class Graphics {
public:
	int Initialize(HWND &hWnd);
	int LoadCharacterTexture(string texFile);
	int LoadMenuTexture(string texFile);
	int LoadMapTileTexture(string texFile);
	int Shutdown(void);

	void RenderFrame();

	ID3D11Device* dev;					// the pointer to the Direct3D device interface
	int fps;

private:
	IDXGISwapChain* swapchain;			// the pointer to the swap chain interface
	ID3D11DeviceContext* devcon;		// the pointer to the Direct3D device context
	ID3D11RenderTargetView* backbuffer;	// the backbuffer for rendering
	ID3D11InputLayout* pLayout;			// the pointer to the input layout
	ID3D11VertexShader* pVS;			// the pointer to the vertex shader
	ID3D11VertexShader* pVSMenu;
	ID3D11PixelShader* pPS;				// the pointer to the pixel shader
	ID3D11Buffer* pVBuffer;				// the pointer to the vertex buffer
	ID3D11Buffer* pCBuffer;
	ID3D11DepthStencilView* zbuffer;
	ID3D11BlendState* blendstate;
	vector<TEXTURE> CharacterTextures;
	vector<TEXTURE> MenuTextures;
	vector<TEXTURE> MapTileTextures;

	HWND hWnd;

	// functions

	int InitPipeline(void);

	void RenderCharacters();
	void RenderMenu();
	void RenderCursor();
	void RenderMapTiles();
};

#endif